package com.ruoyi.system.api.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.api.mapper.BatchLogMapper;
import com.ruoyi.system.api.domain.BatchLog;
import com.ruoyi.system.api.service.IBatchLogService;
import com.ruoyi.common.core.text.Convert;

/**
 * 批量处理日志Service业务层处理
 * 
 * @author shihx
 * @date 2020-03-11
 */
@Service
public class BatchLogServiceImpl implements IBatchLogService 
{
    @Autowired
    private BatchLogMapper batchLogMapper;

    /**
     * 查询批量处理日志
     * 
     * @param id 批量处理日志ID
     * @return 批量处理日志
     */
    @Override
    public BatchLog selectBatchLogById(Long id)
    {
        return batchLogMapper.selectBatchLogById(id);
    }

    /**
     * 查询批量处理日志列表
     * 
     * @param batchLog 批量处理日志
     * @return 批量处理日志
     */
    @Override
    public List<BatchLog> selectBatchLogList(BatchLog batchLog)
    {
        return batchLogMapper.selectBatchLogList(batchLog);
    }

    /**
     * 新增批量处理日志
     * 
     * @param batchLog 批量处理日志
     * @return 结果
     */
    @Override
    public int insertBatchLog(BatchLog batchLog)
    {
        batchLog.setCreateTime(DateUtils.getNowDate());
        return batchLogMapper.insertBatchLog(batchLog);
    }

    /**
     * 修改批量处理日志
     * 
     * @param batchLog 批量处理日志
     * @return 结果
     */
    @Override
    public int updateBatchLog(BatchLog batchLog)
    {
        batchLog.setUpdateTime(DateUtils.getNowDate());
        return batchLogMapper.updateBatchLog(batchLog);
    }

    /**
     * 删除批量处理日志对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteBatchLogByIds(String ids)
    {
        return batchLogMapper.deleteBatchLogByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除批量处理日志信息
     * 
     * @param id 批量处理日志ID
     * @return 结果
     */
    @Override
    public int deleteBatchLogById(Long id)
    {
        return batchLogMapper.deleteBatchLogById(id);
    }
}
